home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Enigma Amiga Life 109
/
EnigmaAmiga109CD.iso
/
dalla rivista
/
amiga.free
/
sorgenti vari
/
wolfedit2 2.0.4 source.sit
/
WolfEdit2 2.0.4 Source
/
UExtension.p
< prev
next >
Wrap
Text File
|
1995-04-02
|
1KB
|
71 lines
unit UExtension;
interface
procedure LoadExtensions;
implementation
const
extensionFileType = 'W3E2';
couldntLoadExtensionAlrtID = 139;
extensionLoadedAlrtID = 140;
loadExtensionAlrtID = 141;
function ExtensionsDisabled: boolean;
var
e: EventRecord;
begin
if GetNextEvent(0, e) then
;
ExtensionsDisabled := BAND(e.modifiers, shiftKey) <> 0;
end;
procedure LoadExtensions;
var
pb: CInfoPBRec;
name: Str255;
refNum: integer;
i: integer;
procedure Check (result: OSErr);
var
item: integer;
begin
ParamText(name, StringOf(result : 1), '', '');
if result = noErr then
{item := Alert(extensionLoadedAlrtID, nil)}
else
item := Alert(couldntLoadExtensionAlrtID, nil);
end;
function GetCatInfo (i: integer): boolean;
begin
with pb do begin
ioCompletion := nil;
ioNamePtr := @name;
ioVRefNum := 0;
ioFDirIndex := i;
ioDirID := 0;
end;
GetCatInfo := PBGetCatInfo(@pb, false) = noErr;
end;
begin {LoadExtensions}
if not ExtensionsDisabled then begin
i := 1;
while GetCatInfo(i) do begin
if pb.ioFlFndrInfo.fdType = extensionFileType then begin
ParamText(name, '', '', '');
if Alert(loadExtensionAlrtID, nil) = ok then begin
refNum := OpenResFile(name);
Check(ResError);
end;
end;
i := i + 1;
end;
end;
end;
end.